<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>    
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<c:set var="contextPath" value="${pageContext.request.contextPath}" />    

<!doctype html>
<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>우리학교</title>
	<link rel="stylesheet" href="${contextPath}/css/write.css" type="text/css" />
	<script type="text/javascript">  
		var contextPath = "${contextPath}";
	</script>
	<script type="text/javascript" src="${contextPath}/js/common/jquery-1.6.4.js"></script>
	<script type="text/javascript" src="${contextPath}/js/common/jquery.form.js"></script>
	<script type="text/javascript" src="${contextPath}/js/write.js"></script>
	<script type="text/javascript" src="${contextPath}/smarteditor/js/HuskyEZCreator.js" charset="utf-8"></script>
</head>
<body> 

	<div id="wrap">
		
		<jsp:include page="common/top.jsp" />
		
		<div id="middle">
			<div id="middleLeft">
				<ul id="middleMenu">
					<li>
						<a class="1" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="2" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="3" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<!-- 
					<li class="hoverMenu">
					 -->
					<li>
						<a class="4" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="5" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="6" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li> 
					<li> 
						<a class="7" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>  
					<li>
						<a class="8" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="9" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="10" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="11" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="12" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="13" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
					<li>
						<a class="14" href="#"><span class="menuName">메뉴 게시판 111</span> <span class="gt">&gt;</span></a>
					</li>
				</ul>
			</div>
			<div id="middleCenter">
				<div id="middleCenterWrap">
					<form:form commandName="articleCommand">
						<form:hidden path="articleMenu" />
						<dl id="boardInfo"> 
							<dt id="boardName">메뉴 게시판 111</dt>
							<dd id="boardComment">메뉴 게시판 111입니다.</dd>
							<dd id="writeBt">
								<input type="submit" id="wrtieBt" onclick="submitContents(this);" value="등록하기" />
							</dd>  
						</dl>   
						
						<dl id="titleZone">
							<dt>제목</dt>
							<dd><form:input path="title" maxlength="100" /></dd>
						</dl> 
						
						<div id="textareaZone">
							<form:textarea path="content" rows="10" cols="100" cssStyle="width:620px; height:412px;display:none;" />
						</div>  
						
						<script type="text/javascript">
							var oEditors = [];
							nhn.husky.EZCreator.createInIFrame({
								oAppRef: oEditors,
								elPlaceHolder: "content",
								sSkinURI: "${contextPath}/html/SmartEditor2Skin.html",
								fCreator: "createSEditor2"
							});
							
							function pasteHTML() {
								var sHTML = "<span style='color:#FF0000;'>이미지도 같은 방식으로 삽입합니다.<\/span>";
								oEditors.getById["content"].exec("PASTE_HTML", [sHTML]);
							}

							function showHTML() {
								var sHTML = oEditors.getById["content"].getIR();
								alert(sHTML);
							}
								
							function submitContents(elClickedObj) {
								oEditors.getById["content"].exec("UPDATE_CONTENTS_FIELD", []);	// 에디터의 내용이 textarea에 적용됩니다.
								
								// 에디터의 내용에 대한 값 검증은 이곳에서 document.getElementById("ir1").value를 이용해서 처리하면 됩니다.
								
								try {
									elClickedObj.form.submit();
								} catch(e) {}
							}

							function setDefaultFont() {
								var sDefaultFont = '궁서';
								var nFontSize = 24;
								oEditors.getById["content"].setDefaultFont(sDefaultFont, nFontSize);
							}
							
						</script>  
				  	</form:form>
				</div>
			</div>
			<div id="middleRight"></div>  
		</div>
		
		
		
		<jsp:include page="common/bottom.jsp" />	
				  
	</div>
	
</body>
</html>  